(function () {
  "use strict";

  var global = tinymce.util.Tools.resolve("tinymce.PluginManager");

  const register$1 = editor => {
    editor.addCommand('starEditor', () => {
      // 1.  对选中部分进行操作
      let _text = editor.selection.getContent()
      editor.selection.setContent(_text + '给你们五星好评')
      // 2. 对项目已有元素进行操作
      // 返回内容
    });
  };

  const register = editor => {
    const onAction = () => editor.execCommand('starEditor');
    editor.ui.registry.addButton('star', {
      icon: 'star',
      tooltip: 'get star',
      onAction
    });
    editor.ui.registry.addMenuItem('star', {
      icon: 'star',
      text: 'get star',
      onAction
    });
  };


  var Plugin = () => {
    global.add("star", (editor) => {
      register$1(editor);
      register(editor);
      return {};
    });
  };

  Plugin();
})();
